package demo2;

abstract class Shape{
    public int a;
    public void func(){
        System.out.println("测试普通方法！");
    }
    public abstract void draw();
}

abstract class A extends  Shape{
    public  abstract void funcA();
}
class B extends A{
    @Override
    public void funcA() {

    }
    @Override
    public void draw() {

    }
}

class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("♦");
    }
}
class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}
class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("🔺");
    }
}
public class test {
    public static  void drawmap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Shape shape=new Rect();//抽象类不能被实例化
        drawmap(shape);
        Triangle triangle=new Triangle();
        drawmap(triangle);
    }
}






























